#include<iostream>
#include<cstring>
using namespace std;
char str[100];
int main()
{
	int n;
	while(cin >> n)
	{
		while(n--)
		{
			memset(str, 0, sizeof(str));
			cin >> str;
			int len = strlen(str);
			int count1 = 0, count2 = 0;
			for(int i = 0; i < len; i++)
			{
				if(str[i] == 'a' || str[i] == 'e' || str[i] == 'i' || str[i] == 'o' || str[i] == 'u')
					count1++;
				else count2++;
			}
			cout << str << endl;
			if(count1 > count2) cout << "1" << endl;
			else cout << "0" << endl;
		}
	}
	return 0;
}
